package cn.fl.upgrade.service;

import java.util.List;
import java.util.Map;

import cmm.comm.facade.upgrade.dto.SysAppVerRuleDTO;
import cn.fl.upgrade.vo.SysAppVerRuleVO;
import org.springframework.web.multipart.MultipartHttpServletRequest;

import cmm.comm.facade.upgrade.condition.SysAppVerCfgQueryCondition;
import cmm.comm.facade.upgrade.dto.SysAppVerCfgDTO;
import cmm.mid.core.framework.page.KeyValueVO;
import cmm.mid.core.framework.page.Pager;
import cn.cmm.base.framework.exception.BaseException;
import cn.fl.upgrade.vo.SysAppVerCfgVO;

/**
 * @Description: 移动APP版本配置表 客户端服务层接口
 * @Description: 持久层方法名称前缀：新增：insert* 删除：delete* 修改：update* 批量：batch* 查询对象：select* get* find* 查询集合：select*
 * @Description: 业务层方法名称前缀：新增：add* 删除：remove* 修改：modify* 查询对象：select* get* 批量：batch* 查询集合：search*
 */
public interface ISysAppVerCfgService {
	
	/**
	 * 获取唯一对象
	 * @param id 主键
	 * @return 对象DTO
	 */
	public SysAppVerCfgVO selectById(Long id)throws BaseException;
	
	/**
	 * 新增
	 * @param entity
	 * @return
	 */
    public Long add(SysAppVerCfgVO entity,String traceId) throws BaseException;

    /**
     * 删除
     * @param id
     * @return
     */
    public boolean removeById(Long id)throws BaseException;
    
    /**
     * 删除
     * @param ids
     * @return
     */
    public boolean removeByIds(List<Long> ids)throws BaseException;

    /**
     * 修改
     * @param entity
     * @return
     */
    public boolean modify(SysAppVerCfgVO entity,String traceId)throws BaseException;

    /**
     * 查询版本信息
     * @param condition
     * @return
     * @throws BaseException
     */
    public List<SysAppVerCfgDTO> searchList(SysAppVerCfgQueryCondition condition) throws BaseException;

    /**
     * 分页查询所有
     * @param page
     * @return
     */
    public Pager searchListPage(Pager page)throws BaseException;

    /**
     * 数据字典服务
     * @param codeGrpCd
     * @param sysCd
     * @param orgCd
     * @return
     * @throws BaseException
     */
    public List<KeyValueVO> getKvList(String codeGrpCd, String sysCd, String orgCd) throws BaseException;
    public Map<String, String> searchGroupToMap(String sysCd, String orgCd, String codeGrpCd) throws BaseException;
    public List<KeyValueVO> getKvListWithAttr1(String grpCd, String filterCodeAttr1, String sysCd, String orgCd) throws BaseException;
    public List<KeyValueVO> getKvListWithAttr1AndAttr2(String grpCd, String filterCodeAttr1,String filterCodeAttr2, String sysCd, String orgCd) throws BaseException;
    /**
     * 获取更新版本信息
     */
    public SysAppVerCfgDTO getSysAppVerCfg(SysAppVerCfgQueryCondition condition)throws BaseException;

    /**
     * TODO 获取最新升级版本
     * @methodName getUpgradeAppVer
     * @author: zhangxianchao@lionbridgecapital.cn
     * @createDate: 2019/3/20 11:59
     * @version: V1.0.0
     * @param condition
     * @return cmm.comm.facade.upgrade.dto.SysAppVerCfgDTO
     * @updateRemark [1][2019-03-20] [张现超][版本升级]
     */
    public SysAppVerCfgDTO getUpgradeAppVer(SysAppVerCfgQueryCondition condition) throws BaseException;

    /**
     * 文件上传阿里云
     * @param file
     * @return
     * @throws BaseException
     */
    public String uploadToOss(MultipartHttpServletRequest multipartRequest,String sysCd,String opTypCd,String verNo) throws BaseException;

    /**
     * 获取升级版本号
     * @return
     * @throws BaseException
     */
    public Long getVerId() throws BaseException;

    /**
     * @MethodName selectMaxVerId
     * @Description: 查询最大的编号信息
     * @Author: wangpengtao@lionbridgecapital.cn
     * @CreateDate: 2019/11/25 14:43
     * @Version: V1.0.0
     * @Param opTypCd
     * @Param sysCd
     * @Return java.lang.Integer
     * @UpdateRemark [序号][YYYY-MM-DD] [更改人姓名][变更描述]
     */
    public Integer selectMaxVerId(String opTypCd,String sysCd) throws BaseException;

    /**
     * @MethodName selectMaxVerId
     * @Description: 查询最大的编号后设置
     * @Author: wangpengtao@lionbridgecapital.cn
     * @CreateDate: 2019/11/25 14:43
     * @Version: V1.0.0
     * @Param opTypCd
     * @Param sysCd
     * @Return java.lang.Integer
     * @UpdateRemark [序号][YYYY-MM-DD] [更改人姓名][变更描述]
     */
    public List<SysAppVerRuleDTO> selectMaxVerList(Integer verId, String opTypCd, String sysCd) throws BaseException;

}
